import java.sql.SQLException;
import java.sql.Statement;
import java.util.concurrent.TimeUnit;

public class Reader extends People{
    private BorrowManage borrowManage;
    private PersonManage personManage;
    //首页
    public void home() throws InterruptedException, SQLException, ClassNotFoundException {
        personManage=new PersonManage();
        borrowManage=new BorrowManage();
        while(true) {
            System.out.flush();
            menuHome();
            int x = sc.nextInt();
            switch (x) {
                case 1://个人中心
                    personManage.home(this);
                    break;
                case 2://借阅管理?
                    borrowManage.home(this);
                    break;
                case 0://退出登录
                    break;
                default:
                    System.out.println("非法输入");
                    TimeUnit.SECONDS.sleep(1);
                    break;
            }
            if(x==0||super.getType()==-1){
                break;
            }
        }
    }
    //菜单
    public void menuHome(){
        System.out.println("---------读者界面---------");
        System.out.println("1.个人管理   2.借阅管理");
        System.out.println("0.退出登录");
        System.out.println("请选择=>");
    }
}
